

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/IKKIS_LOGO.png">
  <link rel="icon" href="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/IKKIS_LOGO.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Ikki">
  <meta name="keywords" content="">
  
    <meta name="description" content="1. Linux    Linux是一套免费使用和自由传播的类Unix操作系统   在服务器端领域和嵌入式领域有非常广泛的应用  2.版本 分为内核版本和发型版本    kernel 各个厂商会制作自己的发行版本   redhat   CentOS   ubuntu   fedora    3. Linux与Windows的不同    Linux严格区分大小写   Linux中所有的内容以文件形式">
<meta property="og:type" content="article">
<meta property="og:title" content="01.linux基础命令">
<meta property="og:url" content="http://81.68.132.127/2022/10/23/dev_ops/linux/linux%E5%9F%BA%E7%A1%80%E5%91%BD%E4%BB%A4/index.html">
<meta property="og:site_name" content="IKKI">
<meta property="og:description" content="1. Linux    Linux是一套免费使用和自由传播的类Unix操作系统   在服务器端领域和嵌入式领域有非常广泛的应用  2.版本 分为内核版本和发型版本    kernel 各个厂商会制作自己的发行版本   redhat   CentOS   ubuntu   fedora    3. Linux与Windows的不同    Linux严格区分大小写   Linux中所有的内容以文件形式">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/beijing/iTab-57o619.jpeg">
<meta property="article:published_time" content="2022-10-23T15:11:05.000Z">
<meta property="article:modified_time" content="2022-10-29T17:22:31.930Z">
<meta property="article:author" content="Ikki">
<meta property="article:tag" content="运维">
<meta property="article:tag" content="linux">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/beijing/iTab-57o619.jpeg">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>01.linux基础命令 - IKKI</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  



  
<link rel="stylesheet" href="/fluid/css/fluid-extention.css">
<link rel="stylesheet" href="/fluid/css/nihao.css">



  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"81.68.132.127","root":"/","version":"1.9.3","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":3},"lazyload":{"enable":true,"loading_img":"https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 100vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Ikki-BUG制造者</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('http://image.ikki0603.cn') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="01.linux基础命令"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-10-23 23:11" pubdate>
          2022年10月23日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          6.2k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          52 分钟
        
      </span>
    

    
    
      
        <span id="busuanzi_container_page_pv" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="busuanzi_value_page_pv"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
        <div class="scroll-down-bar">
          <i class="iconfont icon-arrowdown"></i>
        </div>
      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">01.linux基础命令</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：2022年10月30日 凌晨
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h2 id="1-Linux"><a href="#1-Linux" class="headerlink" title="1. Linux "></a>1. Linux </h2><ul>
<li>  Linux是一套免费使用和自由传播的类Unix操作系统</li>
<li>  在服务器端领域和嵌入式领域有非常广泛的应用</li>
</ul>
<h2 id="2-版本"><a href="#2-版本" class="headerlink" title="2.版本 "></a>2.版本 </h2><p>分为内核版本和发型版本</p>
<ul>
<li>  <a target="_blank" rel="noopener" href="https://www.kernel.org/">kernel</a></li>
<li>各个厂商会制作自己的发行版本<ul>
<li>  redhat</li>
<li>  CentOS</li>
<li>  ubuntu</li>
<li>  fedora</li>
</ul>
</li>
</ul>
<h2 id="3-Linux与Windows的不同"><a href="#3-Linux与Windows的不同" class="headerlink" title="3. Linux与Windows的不同 "></a>3. Linux与Windows的不同 </h2><ul>
<li>  Linux严格区分大小写</li>
<li>  Linux中所有的内容以文件形式保存，包括硬件、用户和文件。</li>
<li>Linux不靠扩展名区分文件类型，是靠权限来区分，但是有一些约定的扩展名，是给管理员看的<ul>
<li>  压缩包 <code>.gz</code> <code>.bz2</code> <code>.tar.bz2</code> <code>.tgz</code></li>
<li>  二进制文件 <code>.rpm</code></li>
<li>  网页文件 <code>.html .php</code></li>
<li>  脚本文件 <code>.sh</code></li>
<li>  配置文件 <code>.conf</code></li>
</ul>
</li>
<li>  Windows下的程序不能直接在Linux中安装和运行</li>
<li>Linux更多使用字符界面<ul>
<li>  占用的系统资源更少</li>
<li>  减少了出错和被攻击的可能性，会让系统更稳定</li>
</ul>
</li>
</ul>
<h2 id="4-连接服务器"><a href="#4-连接服务器" class="headerlink" title="4. 连接服务器 "></a>4. 连接服务器 </h2><ul>
<li>  git bash</li>
<li>  mac shell</li>
<li>  <a target="_blank" rel="noopener" href="https://img.zhufengpeixun.com/xshell4.zip">xshell4</a></li>
<li>  <a target="_blank" rel="noopener" href="https://img.zhufengpeixun.com/xftp4.zip">xftp4</a></li>
</ul>
<h2 id="5-linux常用命令"><a href="#5-linux常用命令" class="headerlink" title="5.linux常用命令 "></a>5.linux常用命令 </h2><h3 id="5-1-常见目录"><a href="#5-1-常见目录" class="headerlink" title="5.1 常见目录"></a>5.1 常见目录</h3><table>
<thead>
<tr>
<th>目录</th>
<th>用途</th>
</tr>
</thead>
<tbody><tr>
<td>/</td>
<td>根目录</td>
</tr>
<tr>
<td>/boot</td>
<td>启动目录，启动相关文件</td>
</tr>
<tr>
<td>/dev</td>
<td>设备文件</td>
</tr>
<tr>
<td>/etc</td>
<td>配置文件</td>
</tr>
<tr>
<td>/home</td>
<td>普通用户的家目录,可以操作</td>
</tr>
<tr>
<td>/lib</td>
<td>系统库保存目录</td>
</tr>
<tr>
<td>/mnt</td>
<td>移动设备挂载目录</td>
</tr>
<tr>
<td>/media</td>
<td>光盘挂载目录</td>
</tr>
<tr>
<td>/misc</td>
<td>磁带机挂载目录</td>
</tr>
<tr>
<td>/root</td>
<td>超级用户的家目录,可以操作</td>
</tr>
<tr>
<td>/tmp</td>
<td>临时目录,可以操作</td>
</tr>
<tr>
<td>/proc</td>
<td>正在运行的内核信息映射, 主要输出进程信息、内存资源信息和磁盘分区信息等等</td>
</tr>
<tr>
<td>/sys</td>
<td>硬件设备的驱动程序信息</td>
</tr>
<tr>
<td>/var</td>
<td>变量</td>
</tr>
<tr>
<td>/bin</td>
<td>普通的基本命令，如ls,chmod等,一般的用户也都可以使用</td>
</tr>
<tr>
<td>/sbin</td>
<td>基本的系统命令，如shutdown，reboot，用于启动系统，修复系统,只有管理员才可以运行</td>
</tr>
<tr>
<td>/usr/bin</td>
<td>是你在后期安装的一些软件的运行脚本</td>
</tr>
<tr>
<td>/usr/sbin</td>
<td>放置一些用户安装的系统管理的必备程序</td>
</tr>
</tbody></table>
<h3 id="5-2-命令基本格式"><a href="#5-2-命令基本格式" class="headerlink" title="5.2 命令基本格式"></a>5.2 命令基本格式</h3><h4 id="5-2-1-命令提示符"><a href="#5-2-1-命令提示符" class="headerlink" title="5.2.1 命令提示符"></a>5.2.1 命令提示符</h4><figure class="highlight autoit"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-vne1bolacl5vpe"></i><span>autoit</span><div class="collapse show" id="collapse-vne1bolacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs autoit">[root<span class="hljs-symbol">@zhangrenyang</span> ~]<span class="hljs-meta">#</span><br><br></code></pre></td></tr></table></div></figure>

<ul>
<li>  root 当前登录用户</li>
<li>  localhost 主机名</li>
<li>  ~ 当前工作目录,默认是当前用户的家目录，root就是/root,普通用户是 /home/用户名</li>
<li>  提示符 超级用户是 #,普通用户是$</li>
</ul>
<h4 id="5-2-2-命令格式"><a href="#5-2-2-命令格式" class="headerlink" title="5.2.2 命令格式"></a>5.2.2 命令格式</h4><ul>
<li>  命令 [选项] [参数]</li>
<li>  当有多个选项时，可以写在一起</li>
<li>  一般参数有简化和完整写法两种 <code>-a</code> 与 <code>--all</code>等效</li>
</ul>
<h4 id="5-2-3-ls"><a href="#5-2-3-ls" class="headerlink" title="5.2.3 ls"></a>5.2.3 ls</h4><ul>
<li>  查询目录中的内容</li>
<li>  ls [选项] [文件或者目录]</li>
<li>选项<ul>
<li>  -a 显示所有文件，包括隐藏文件</li>
<li>  -l 显示详细信息</li>
<li>  -d 查看目录本身的属性而非子文件 ls /etc/</li>
<li>  -h 人性化的方式显示文件大小</li>
</ul>
</li>
<li>  默认当前目录下的文件列表</li>
</ul>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-0y5nurlacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-0y5nurlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">ls</span> -l<br></code></pre></td></tr></table></div></figure>

<h5 id="5-2-3-1-l"><a href="#5-2-3-1-l" class="headerlink" title="5.2.3.1 -l"></a>5.2.3.1 -l</h5><p>显示详细信息</p>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-ba2135lacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-ba2135lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">drwxr</span>-xr-x  root  root   <span class="hljs-number">800</span> Sep <span class="hljs-number">16</span> <span class="hljs-number">00</span>:<span class="hljs-number">19</span> logs<br></code></pre></td></tr></table></div></figure>

<table>
<thead>
<tr>
<th>drwxr-xr-x</th>
<th>root</th>
<th>root</th>
<th>800</th>
<th>Sep 16 00:19</th>
<th>logs</th>
</tr>
</thead>
<tbody><tr>
<td>文件类型和权限</td>
<td>所有者</td>
<td>所属组</td>
<td>文件大小</td>
<td>最后修改时间</td>
<td>文件名</td>
</tr>
</tbody></table>
<h3 id="5-3-文件处理命令"><a href="#5-3-文件处理命令" class="headerlink" title="5.3 文件处理命令"></a>5.3 文件处理命令</h3><h4 id="5-3-1-mkdir"><a href="#5-3-1-mkdir" class="headerlink" title="5.3.1 mkdir"></a>5.3.1 mkdir</h4><ul>
<li>  建立目录 make directory</li>
<li>mkdir -p [目录名]<ul>
<li>  -p 递归创建</li>
</ul>
</li>
</ul>
<figure class="highlight arduino"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-rfmk5placl5vpe"></i><span>arduino</span><div class="collapse show" id="collapse-rfmk5placl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs arduino">mkdir -p hello<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-2-cd"><a href="#5-3-2-cd" class="headerlink" title="5.3.2 cd"></a>5.3.2 cd</h4><ul>
<li>  切换所在目录 change directory</li>
<li>cd [目录]<ul>
<li>  ~ 家目录</li>
<li>  . 当前目录</li>
<li>  .. 上级目录</li>
</ul>
</li>
<li>  相对路径是参照当前所在目录</li>
<li>  绝对路径是从根目录开始</li>
<li>  按TAB键可以补全命令和目录</li>
</ul>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-gmpl4qlacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-gmpl4qlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cd</span> hello<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-3-pwd"><a href="#5-3-3-pwd" class="headerlink" title="5.3.3 pwd"></a>5.3.3 pwd</h4><ul>
<li>  显示当前目录 pwd</li>
</ul>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-sx6kmclacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-sx6kmclacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">pwd</span><br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-4-rmdir"><a href="#5-3-4-rmdir" class="headerlink" title="5.3.4 rmdir"></a>5.3.4 rmdir</h4><ul>
<li>  删除目录 remove empty directory</li>
<li>  rmdir [目录名]</li>
</ul>
<figure class="highlight arduino"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-qxy1eelacl5vpe"></i><span>arduino</span><div class="collapse show" id="collapse-qxy1eelacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs arduino">rmdir hello<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-5-rm"><a href="#5-3-5-rm" class="headerlink" title="5.3.5 rm"></a>5.3.5 rm</h4><ul>
<li>  删除文件或者目录 remove</li>
<li>rm [文件或者目录]<ul>
<li>  -r 删除目录</li>
<li>  -f 强制删除</li>
</ul>
</li>
<li>  rm -rf 文件或者目录] 递归强制删除所有目录</li>
</ul>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-j1emvblacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-j1emvblacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">rm</span> -rf hello<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-6-cp"><a href="#5-3-6-cp" class="headerlink" title="5.3.6 cp"></a>5.3.6 cp</h4><ul>
<li>  copy 复制命令</li>
<li>copy [源文件或者目录] [目标文件]<ul>
<li>  -r 复制目录,默认是复制文件</li>
<li>  -i 会在复制文件的时候给提示,如果复制的目标文件存在,会给你提示是否要覆盖</li>
</ul>
</li>
</ul>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-cxc0gvlacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-cxc0gvlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">mkdir</span> afolder<br><span class="hljs-built_in">mkdir</span> bfolder<br><span class="hljs-built_in">cd</span> afolder/<br><span class="hljs-built_in">touch</span> 1.txt<br><span class="hljs-built_in">cp</span> 1.txt ~/bfolder/<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-7-mv"><a href="#5-3-7-mv" class="headerlink" title="5.3.7 mv"></a>5.3.7 mv</h4><ul>
<li>  移动文件或者改名 move</li>
<li>  mv [源文件或者目录] [目标文件]</li>
</ul>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-8tlu14lacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-8tlu14lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">mv</span> <span class="hljs-number">1</span>.txt <span class="hljs-number">11</span>.txt<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-3-8-ln"><a href="#5-3-8-ln" class="headerlink" title="5.3.8 ln"></a>5.3.8 ln</h4><ul>
<li>  链接命令,生成链接文件 <code>link</code></li>
<li>ln -s [源文件] [目标文件]<ul>
<li>  -s 创建软链接</li>
</ul>
</li>
<li>  类似Windows快捷方式</li>
<li>  修改任意一个文件，另一个都会改变</li>
<li>  删除源文件，软链接不能使用</li>
<li>  软链接源文件必须写绝对路径</li>
</ul>
<figure class="highlight shell"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-kcwtwrlacl5vpe"></i><span>shell</span><div class="collapse show" id="collapse-kcwtwrlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash"><span class="hljs-built_in">ln</span> -s /root/bfolder/11.txt 22.txt</span><br><br></code></pre></td></tr></table></div></figure>

<h3 id="5-4-文件搜索命令"><a href="#5-4-文件搜索命令" class="headerlink" title="5.4 文件搜索命令"></a>5.4 文件搜索命令</h3><h4 id="5-4-1-locate"><a href="#5-4-1-locate" class="headerlink" title="5.4.1 locate"></a>5.4.1 locate</h4><ul>
<li>  在后台数据库中按文件名搜索，速度比较快</li>
<li>  数据保存在<code>/var/lib/mlocate/mlocate.db</code>后台数据库，每天更新一次</li>
<li>  可以<code>updatedb</code>命令立刻更新数据库</li>
<li>  只能搜索文件名</li>
</ul>
<figure class="highlight cmake"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-7ginzhlacl5vpe"></i><span>cmake</span><div class="collapse show" id="collapse-7ginzhlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs cmake">yum  -y <span class="hljs-keyword">install</span> mlocate<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-4-2-whereis"><a href="#5-4-2-whereis" class="headerlink" title="5.4.2 whereis"></a>5.4.2 whereis</h4><ul>
<li>  搜索命令所在路径以及帮助文档所在位置</li>
<li>whereis 命令名 <code>whereis ls</code><ul>
<li>  -b 只查找可执行文件</li>
<li>  -m 只查找帮助文件</li>
</ul>
</li>
<li>  可以查看Shell自带的命令，如 <code>whereis cd</code></li>
</ul>
<h4 id="5-4-3-which"><a href="#5-4-3-which" class="headerlink" title="5.4.3 which"></a>5.4.3 which</h4><ul>
<li>  可以看到别名 <code>which ls</code></li>
<li>  能看到的都是外部安装的命令</li>
<li>  无法查看Shell自带的命令，如 <code>which cd</code></li>
</ul>
<h4 id="5-4-4-环境变量"><a href="#5-4-4-环境变量" class="headerlink" title="5.4.4 环境变量"></a>5.4.4 环境变量</h4><p><code>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</code></p>
<ul>
<li>  定义的是系统搜索命令的路径</li>
<li>  echo $PATH</li>
</ul>
<h4 id="5-4-5-find"><a href="#5-4-5-find" class="headerlink" title="5.4.5 find"></a>5.4.5 find</h4><ul>
<li>  文件搜索命令</li>
<li>  find [搜索范围] [搜索条件]</li>
</ul>
<h5 id="5-4-5-1-按名称搜索"><a href="#5-4-5-1-按名称搜索" class="headerlink" title="5.4.5.1 按名称搜索"></a>5.4.5.1 按名称搜索</h5><ul>
<li>避免大范围的搜索，会非常消耗系统资源  <figure class="highlight routeros"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-wmnzwflacl5vpe"></i><span>routeros</span><div class="collapse show" id="collapse-wmnzwflacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs routeros"><span class="hljs-built_in">find</span> / -name 11.txt<br></code></pre></td></tr></table></div></figure>
</li>
</ul>
<h5 id="5-4-5-2-通配符"><a href="#5-4-5-2-通配符" class="headerlink" title="5.4.5.2 通配符"></a>5.4.5.2 通配符</h5><ul>
<li>  find是在系统当中搜索符合条件的文件名，如果需要匹配，使用通配符匹配，通配符是完全匹配</li>
<li>通配符<ul>
<li>  <code>*</code> 匹配任意内容</li>
<li>  <code>?</code> 匹配任意一个字符</li>
<li>  <code>[]</code> 匹配任意一个中括号内的字符</li>
</ul>
</li>
</ul>
<figure class="highlight shell"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-3teglklacl5vpe"></i><span>shell</span><div class="collapse show" id="collapse-3teglklacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash"><span class="hljs-built_in">touch</span> abc.txt</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">find . -name <span class="hljs-string">&quot;ab[cdef].txt&quot;</span></span><br><br></code></pre></td></tr></table></div></figure>

<h5 id="5-4-5-3-i"><a href="#5-4-5-3-i" class="headerlink" title="5.4.5.3 -i"></a>5.4.5.3 -i</h5><ul>
<li>  不区分大小写</li>
</ul>
<figure class="highlight routeros"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-2e7j6vlacl5vpe"></i><span>routeros</span><div class="collapse show" id="collapse-2e7j6vlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs routeros"><span class="hljs-built_in">find</span> . -iname <span class="hljs-string">&quot;Ab[cdef].txt&quot;</span><br><br></code></pre></td></tr></table></div></figure>

<h5 id="5-4-5-4-user"><a href="#5-4-5-4-user" class="headerlink" title="5.4.5.4 -user"></a>5.4.5.4 -user</h5><ul>
<li>  按所有者进行搜索</li>
</ul>
<figure class="highlight routeros"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-qxegxzlacl5vpe"></i><span>routeros</span><div class="collapse show" id="collapse-qxegxzlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs routeros"><span class="hljs-built_in">find</span> /root -user root<br><span class="hljs-built_in">find</span> /root -nouser<br><br></code></pre></td></tr></table></div></figure>

<h5 id="5-4-5-5-按时间搜索"><a href="#5-4-5-5-按时间搜索" class="headerlink" title="5.4.5.5 按时间搜索"></a>5.4.5.5 按时间搜索</h5><figure class="highlight routeros"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-n4zaedlacl5vpe"></i><span>routeros</span><div class="collapse show" id="collapse-n4zaedlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs routeros"><span class="hljs-built_in">find</span> . -mtime +5<br><br></code></pre></td></tr></table></div></figure>

<table>
<thead>
<tr>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>atime</td>
<td>文件访问时间</td>
</tr>
<tr>
<td>ctime</td>
<td>改变文件属性</td>
</tr>
<tr>
<td>mtime</td>
<td>修改文件内容</td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>-5</td>
<td>5天内修改的文件</td>
</tr>
<tr>
<td>5</td>
<td>5天前当前修改的文件</td>
</tr>
<tr>
<td>+5</td>
<td>5天前修改的文件</td>
</tr>
</tbody></table>
<h5 id="5-4-5-6-按大小搜索"><a href="#5-4-5-6-按大小搜索" class="headerlink" title="5.4.5.6 按大小搜索"></a>5.4.5.6 按大小搜索</h5><ul>
<li>  k小写,M大写</li>
</ul>
<figure class="highlight arduino"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-5749yslacl5vpe"></i><span>arduino</span><div class="collapse show" id="collapse-5749yslacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs arduino">find . -size +<span class="hljs-number">0</span>k<br><br></code></pre></td></tr></table></div></figure>

<table>
<thead>
<tr>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>-8k</td>
<td>小于8K</td>
</tr>
<tr>
<td>8k</td>
<td>等于8K</td>
</tr>
<tr>
<td>+8k</td>
<td>大于8K</td>
</tr>
<tr>
<td>+8M</td>
<td>小于8M</td>
</tr>
</tbody></table>
<h5 id="5-4-5-7-综合应用"><a href="#5-4-5-7-综合应用" class="headerlink" title="5.4.5.7 综合应用"></a>5.4.5.7 综合应用</h5><figure class="highlight arduino"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-savwlblacl5vpe"></i><span>arduino</span><div class="collapse show" id="collapse-savwlblacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs arduino">find /tmp -size +<span class="hljs-number">10</span>k -a -size <span class="hljs-number">-20</span>k<br><br></code></pre></td></tr></table></div></figure>

<ul>
<li>  查找/etc目录下，大于10KB并且小于20KB的文件</li>
<li>  -a and 逻辑与，两个条件都满足</li>
<li>  -o or 逻辑或，两个条件满足一个就可以</li>
</ul>
<figure class="highlight mel"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-eg7apclacl5vpe"></i><span>mel</span><div class="collapse show" id="collapse-eg7apclacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs mel">find /tmp -<span class="hljs-keyword">size</span> +<span class="hljs-number">10</span>k -a -<span class="hljs-keyword">size</span> <span class="hljs-number">-20</span>k -<span class="hljs-keyword">exec</span> <span class="hljs-keyword">ls</span> -lh &#123;&#125; \;<br><br></code></pre></td></tr></table></div></figure>

<ul>
<li>  exec 对上个命令的结果进行操作</li>
</ul>
<h5 id="5-4-5-9-grep"><a href="#5-4-5-9-grep" class="headerlink" title="5.4.5.9 grep"></a>5.4.5.9 grep</h5><ul>
<li>在文件当中匹配符合条件的字符串<ul>
<li>  <code>-i</code> 忽略大小写</li>
<li>  <code>-v</code> 排除指定字符串</li>
</ul>
</li>
<li>  find命令，在系统当中搜索符合条件的文件名，如果需要匹配，使用通配符匹配，通配符是完全匹配</li>
<li>  grep命令 在文件当中搜索符合条件的字符串，如果需要匹配，使用正则表达式进行匹配，正则表达式时包含匹配</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-30-01-22-28_0927c925.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-30-01-22-28"></p>
<figure class="highlight stylus"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-18md5klacl5vpe"></i><span>stylus</span><div class="collapse show" id="collapse-18md5klacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs stylus">vi <span class="hljs-selector-tag">a</span><span class="hljs-selector-class">.txt</span><br>grep <span class="hljs-selector-tag">b</span> <span class="hljs-selector-tag">a</span><span class="hljs-selector-class">.txt</span><br>grep -v <span class="hljs-selector-tag">b</span> <span class="hljs-selector-tag">a</span><span class="hljs-selector-class">.txt</span><br>grep -<span class="hljs-selector-tag">i</span> f <span class="hljs-selector-tag">a</span><span class="hljs-selector-class">.txt</span><br><br></code></pre></td></tr></table></div></figure>

<h3 id="5-5-压缩与解压缩命令"><a href="#5-5-压缩与解压缩命令" class="headerlink" title="5.5 压缩与解压缩命令"></a>5.5 压缩与解压缩命令</h3><h4 id="5-5-1-zip格式"><a href="#5-5-1-zip格式" class="headerlink" title="5.5.1 zip格式"></a>5.5.1 zip格式</h4><ul>
<li>  压缩文件或目录,是一种压缩格式</li>
</ul>
<table>
<thead>
<tr>
<th>功能</th>
<th>命令</th>
</tr>
</thead>
<tbody><tr>
<td>压缩文件</td>
<td>zip 压缩文件名.zip 源文件</td>
</tr>
<tr>
<td>压缩目录</td>
<td>zip -r 压缩目录名.zip 源目录</td>
</tr>
<tr>
<td>解压</td>
<td>unzip 压缩目录名.zip</td>
</tr>
</tbody></table>
<figure class="highlight mipsasm"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-vnotmmlacl5vpe"></i><span>mipsasm</span><div class="collapse show" id="collapse-vnotmmlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs mipsasm">yum <span class="hljs-keyword">install </span>-y unzip zip<br><br>mkdir <span class="hljs-keyword">book</span><br><span class="hljs-keyword"></span>touch <span class="hljs-keyword">book/1.txt</span><br><span class="hljs-keyword"></span>touch <span class="hljs-keyword">book/2.txt</span><br><span class="hljs-keyword"></span>zip -r <span class="hljs-keyword">book.zip </span><span class="hljs-keyword">book</span><br><span class="hljs-keyword"></span>rm -rf <span class="hljs-keyword">book/ </span>rmdir <span class="hljs-keyword">book</span><br><span class="hljs-keyword"></span>unzip <span class="hljs-keyword">book.zip</span><br><span class="hljs-keyword"></span><br></code></pre></td></tr></table></div></figure>

<h4 id="5-5-2-gzip"><a href="#5-5-2-gzip" class="headerlink" title="5.5.2 gzip"></a>5.5.2 gzip</h4><ul>
<li>  gzip为高压，可以把文件压缩得更小</li>
<li>  gzip命令不支持目录</li>
</ul>
<table>
<thead>
<tr>
<th>命令</th>
<th>示例</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>gzip 源文件</td>
<td>gzip book.txt</td>
<td>压缩为.gz格式的压缩文件，源文件会消失</td>
</tr>
<tr>
<td>gzip -c 源文件 &gt; 压缩文件</td>
<td>gzip -c book.txt &gt; book.txt.gz</td>
<td>压缩为.gz格式的压缩文件，源文件不会消失</td>
</tr>
<tr>
<td>gzip -r 目录</td>
<td>gzip -r book</td>
<td>把目录下的每个子文件都变成压缩包，并删除原文件，当前目录无变化</td>
</tr>
<tr>
<td>gzip -d 压缩文件名</td>
<td>gzip -d 1.txt.gz</td>
<td>解压缩文件,不保留压缩包</td>
</tr>
<tr>
<td>gunzip 压缩文件</td>
<td>gunzip 2.txt.gz</td>
<td>解压缩文件,也不保留压缩包</td>
</tr>
</tbody></table>
<ul>
<li>  压缩是压缩目录下的文件</li>
</ul>
<figure class="highlight stylus"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-ph57otlacl5vpe"></i><span>stylus</span><div class="collapse show" id="collapse-ph57otlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs stylus">touch book<span class="hljs-selector-class">.txt</span><br>mkdir book<br>touch book/<span class="hljs-number">1</span><span class="hljs-selector-class">.txt</span><br>touch book/<span class="hljs-number">2</span><span class="hljs-selector-class">.txt</span><br>gzip book<span class="hljs-selector-class">.txt</span> <span class="hljs-comment">//源文件会消失</span><br>gzip -c <span class="hljs-number">1</span><span class="hljs-selector-class">.txt</span> &gt; <span class="hljs-number">1</span><span class="hljs-selector-class">.txt</span><span class="hljs-selector-class">.gz</span> <span class="hljs-comment">//源文件不消失</span><br>gzip book<span class="hljs-selector-class">.txt</span>  <span class="hljs-comment">//压缩为.gz格式文件，源文件会消失</span><br>gzip -r book <span class="hljs-comment">//把目录下的每个子文件都变成压缩包</span><br>cd book<br>gzip -d <span class="hljs-number">1</span><span class="hljs-selector-class">.txt</span><span class="hljs-selector-class">.gz</span>  <span class="hljs-comment">//解压缩文件,不保留压缩包</span><br>gunzip <span class="hljs-number">2</span><span class="hljs-selector-class">.txt</span><span class="hljs-selector-class">.gz</span> <br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-5-3-tar"><a href="#5-5-3-tar" class="headerlink" title="5.5.3 tar"></a>5.5.3 tar</h4><ul>
<li><p>  打包命令,只打包并不压缩</p>
</li>
<li><p><code>tar -cvf</code> 打包文件名 源文件</p>
<ul>
<li>  -c 打包</li>
<li>  -v 显示过程</li>
<li>  -f 指定打包后的文件名</li>
</ul>
  <figure class="highlight awk"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-r7vb7xlacl5vpe"></i><span>awk</span><div class="collapse show" id="collapse-r7vb7xlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs awk">tar -cvf book.tar book    <span class="hljs-regexp">//</span>会打包出一个book.tar文件<br><br></code></pre></td></tr></table></div></figure></li>
<li><p>x 解开包</p>
  <figure class="highlight mipsasm"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-qulpo3lacl5vpe"></i><span>mipsasm</span><div class="collapse show" id="collapse-qulpo3lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs mipsasm">tar -xvf <span class="hljs-keyword">book.tar </span><br><br></code></pre></td></tr></table></div></figure>
</li>
</ul>
<h4 id="5-5-4-tar-gz压缩格式"><a href="#5-5-4-tar-gz压缩格式" class="headerlink" title="5.5.4 tar.gz压缩格式"></a>5.5.4 tar.gz压缩格式</h4><ul>
<li>  <code>zip</code>可以压缩目录但压缩效率不高,<code>gzip</code>压缩效率高但不支持目录</li>
<li>  可以先打包为<code>.tar</code>格式，再压缩为<code>.gz</code>格式 -c 压缩为.tar.gz格式 -x 解压缩.tar.gz格式</li>
</ul>
<table>
<thead>
<tr>
<th>命令</th>
<th>示例</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>tar -zcvf 压缩包名 <code>.tar.gz</code>源文件</td>
<td>tar -zcvf book.tar.gz book</td>
<td>可以先打包为<code>.tar</code>格式，再压缩为<code>.gz</code>格式</td>
</tr>
<tr>
<td>tar -zxvf 压缩包名.tar.gz</td>
<td>tar -zxvf book.tar.gz</td>
<td>解压tar.gz压缩包</td>
</tr>
</tbody></table>
<figure class="highlight stylus"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-vf6kemlacl5vpe"></i><span>stylus</span><div class="collapse show" id="collapse-vf6kemlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs stylus">tar -zcvf book<span class="hljs-selector-class">.tar</span><span class="hljs-selector-class">.gz</span> book<br>tar -zxvf book<span class="hljs-selector-class">.tar</span><span class="hljs-selector-class">.gz</span><br><br></code></pre></td></tr></table></div></figure>

<h3 id="5-6-关机和重启命令"><a href="#5-6-关机和重启命令" class="headerlink" title="5.6 关机和重启命令"></a>5.6 关机和重启命令</h3><h4 id="5-6-1-shutdown"><a href="#5-6-1-shutdown" class="headerlink" title="5.6.1 shutdown"></a>5.6.1 shutdown</h4><ul>
<li>shutdown 关机命令<ul>
<li>  -c 取消前一个关机命令</li>
<li>  -h 关机</li>
<li>  -r 重启</li>
</ul>
</li>
</ul>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-nf8rqylacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-nf8rqylacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">shutdown</span> -r <span class="hljs-number">06</span>:<span class="hljs-number">00</span><br><span class="hljs-attribute">shutdown</span> -c<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-6-2-init"><a href="#5-6-2-init" class="headerlink" title="5.6.2 init"></a>5.6.2 init</h4><p>关机</p>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-krmdlplacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-krmdlplacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">init</span> <span class="hljs-number">0</span><br><br></code></pre></td></tr></table></div></figure>

<p>重启</p>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-203tn8lacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-203tn8lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">init</span> <span class="hljs-number">6</span><br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-6-3-logout"><a href="#5-6-3-logout" class="headerlink" title="5.6.3 logout"></a>5.6.3 logout</h4><p>退出登录</p>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-qit8i2lacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-qit8i2lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">logout</span><br><br></code></pre></td></tr></table></div></figure>

<h3 id="5-7-查看登录用户信息"><a href="#5-7-查看登录用户信息" class="headerlink" title="5.7 查看登录用户信息"></a>5.7 查看登录用户信息</h3><h4 id="5-7-1-w"><a href="#5-7-1-w" class="headerlink" title="5.7.1 w"></a>5.7.1 w</h4><p>查看登录用户信息</p>
<ul>
<li>  USER 登录的用户名</li>
<li>  TTY 登录的终端 tty1 本地终端 pts/0远程终端</li>
<li>  FROM 登录的IP</li>
<li>  LOGIN 登录时间</li>
<li>  IDLE 用户闲置时间</li>
<li>  JCPU 该终端所有进程占用的时间</li>
<li>  PCPU 当前进程所占用的时间</li>
<li>  WHAT 正在执行的命令</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-15-18_252340ee.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-15-18"></p>
<h4 id="5-7-2-who"><a href="#5-7-2-who" class="headerlink" title="5.7.2 who"></a>5.7.2 who</h4><ul>
<li>查看登录用户信息<ul>
<li>  USER 登录的用户名</li>
<li>  TTY 登录的终端 tty1 本地终端 pts/0远程终端</li>
<li>  LOGIN 登录时间（登录的IP）</li>
</ul>
</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-17-00_b0da2b04.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-17-00"></p>
<h4 id="5-7-3-last"><a href="#5-7-3-last" class="headerlink" title="5.7.3 last"></a>5.7.3 last</h4><ul>
<li>  查看当前登录和过去登录的用户信息</li>
<li>默认读取 <code>/var/log/wtmp</code> 文件<ul>
<li>  用户名</li>
<li>  登录终端</li>
<li>  登录IP</li>
<li>  登录时间</li>
<li>  退出时间(在线时间)</li>
</ul>
</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-17-36_4301f717.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-17-36"></p>
<h4 id="5-7-4-lastlog"><a href="#5-7-4-lastlog" class="headerlink" title="5.7.4 lastlog"></a>5.7.4 lastlog</h4><ul>
<li>查看所有用户的最后一次登录时间<ul>
<li>  用户名</li>
<li>  登录终端</li>
<li>  登录IP</li>
<li>  最后一次登录时间</li>
</ul>
</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-18-40_7f700b32.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-17-36"></p>
<h3 id="5-8-文件查看命令"><a href="#5-8-文件查看命令" class="headerlink" title="5.8 文件查看命令"></a>5.8 文件查看命令</h3><h4 id="5-8-1-cat"><a href="#5-8-1-cat" class="headerlink" title="5.8.1 cat"></a>5.8.1 cat</h4><ul>
<li>  cat 命令用于连接文件并打印到标准输出设备上。</li>
<li>  cat [-AbeEnstTuv] [–help] [–version] fileName</li>
<li>参数<ul>
<li>-n 或 –number：由 1 开始对所有输出的行数编号。<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-ee839qlacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-ee839qlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cat</span> -n textfile1<br></code></pre></td></tr></table></div></figure></li>
</ul>
</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-22-38_d8c30173.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-22-38"></p>
<h4 id="5-8-2-more"><a href="#5-8-2-more" class="headerlink" title="5.8.2 more"></a>5.8.2 more</h4><ul>
<li>  Linux more 命令类似 cat ，不过会以一页一页的形式显示，更方便使用者逐页阅读，而最基本的指令就是按空白键（space）就往下一页显示，按 b 键就会往回（back）一页显示，而且还有搜寻字串的功能（与 vi 相似），使用中的说明文件，请按 h 。</li>
<li>  more fileName</li>
</ul>
<figure class="highlight dos"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-tcqrvplacl5vpe"></i><span>dos</span><div class="collapse show" id="collapse-tcqrvplacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs dos"><span class="hljs-built_in">more</span>  testfile<br><br></code></pre></td></tr></table></div></figure>

<h4 id="5-8-3-head"><a href="#5-8-3-head" class="headerlink" title="5.8.3 head"></a>5.8.3 head</h4><ul>
<li>  用来显示开头某个数量的文字区块</li>
</ul>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-tx81vvlacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-tx81vvlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">head</span> -<span class="hljs-number">5</span> readme.txt<br><br></code></pre></td></tr></table></div></figure>

<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-28-41_497647c7.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-28-41"></p>
<h4 id="5-8-4-tail"><a href="#5-8-4-tail" class="headerlink" title="5.8.4 tail"></a>5.8.4 tail</h4><ul>
<li>  tail命令可用于查看文件的内容</li>
<li>  有一个常用的参数 -f 常用于查阅正在改变的日志文件。</li>
<li>  tail [参数] [文件]</li>
<li>参数<ul>
<li>  -f 循环读取</li>
<li>-n&lt;行数&gt; 显示文件的尾部 n 行内容  <figure class="highlight stan"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-tqbvhzlacl5vpe"></i><span>stan</span><div class="collapse show" id="collapse-tqbvhzlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs stan"><span class="hljs-built_in">tail</span> -<span class="hljs-number">5</span> mail.txt<br><span class="hljs-built_in">tail</span> -f access.<span class="hljs-built_in">log</span><br></code></pre></td></tr></table></div></figure>
  <img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-29-02_ef85e8b1.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-29-02"></li>
</ul>
</li>
</ul>
<h5 id="5-8-4-1-选择行数查看"><a href="#5-8-4-1-选择行数查看" class="headerlink" title="5.8.4.1 选择行数查看"></a>5.8.4.1 选择行数查看</h5><ol>
<li>语法格式1：从第X行开始，显示Y行。即显示X~(Y-1)行<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-4kifwilacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-4kifwilacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cat</span> filename | <span class="hljs-built_in">tail</span> -n +X | <span class="hljs-built_in">head</span> -n Y<br></code></pre></td></tr></table></div></figure>
 示例：从第3000行开始，显示1000行；即显示3000~3999行<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-qzoz7nlacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-qzoz7nlacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cat</span> requirements.txt | <span class="hljs-built_in">tail</span> -n +3000 | <span class="hljs-built_in">head</span> -n 1000<br></code></pre></td></tr></table></div></figure>
<img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-30-01-05-32_2f0459ab.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-30-01-05-32"></li>
</ol>
<ol start="2">
<li>语法格式2：显示X行到Y行<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-lngukplacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-lngukplacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cat</span> filename| <span class="hljs-built_in">head</span> -n X | <span class="hljs-built_in">tail</span> -n +Y<br></code></pre></td></tr></table></div></figure>
示例：显示1000行到3000行<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-z75xf7lacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-z75xf7lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cat</span> requirements.txt| <span class="hljs-built_in">head</span> -n 3000 | <span class="hljs-built_in">tail</span> -n +1000<br></code></pre></td></tr></table></div></figure>
<img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-30-01-04-25_d6b2317f.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-30-01-04-25"></li>
</ol>
<h4 id="5-8-5-第二页"><a href="#5-8-5-第二页" class="headerlink" title="5.8.5 第二页"></a>5.8.5 第二页</h4><figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-fqbv12lacl5vpe"></i><span>apache</span><div class="collapse show" id="collapse-fqbv12lacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs apache">　<span class="hljs-attribute">head</span> -<span class="hljs-number">10</span> file | tail -<span class="hljs-number">5</span><br></code></pre></td></tr></table></div></figure>

<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-22-09-30-48_0d674b88.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-22-09-30-48"></p>
<h2 id="6-硬件设备文件名"><a href="#6-硬件设备文件名" class="headerlink" title="6. 硬件设备文件名 "></a>6. 硬件设备文件名 </h2><ul>
<li>  只要插入硬盘，Linux会自动检测和分配名称</li>
<li>  一个硬盘可以分成多个分区，每个分区都会有一个系统分配的名称</li>
<li>  第一块SCSI硬盘名称叫<code>sda</code>,它的第一个分区叫<code>sda1</code></li>
<li>  第一块虚拟化环境的磁盘是<code>vda</code>,它的第一个分区叫<code>vda1</code></li>
<li>  <code>df(disk free)</code> 命令用于显示目前在 Linux 系统上的文件系统磁盘使用情况统计</li>
</ul>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-rggfbllacl5vpe"></i><span>bash</span><div class="collapse show" id="collapse-rggfbllacl5vpe"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">df</span> -h<br><br></code></pre></td></tr></table></div></figure>

<table>
<thead>
<tr>
<th>硬件</th>
<th>设备文件名</th>
</tr>
</thead>
<tbody><tr>
<td>IDE硬盘</td>
<td>/dev/hd[a-d]</td>
</tr>
<tr>
<td>SCSI/SATA/USB硬盘</td>
<td>/dev/sd[a-p]</td>
</tr>
<tr>
<td>virtio磁盘</td>
<td>/dev/vd[a-p]</td>
</tr>
</tbody></table>
<h3 id="6-1-IDE硬盘接口"><a href="#6-1-IDE硬盘接口" class="headerlink" title="6.1 IDE硬盘接口"></a>6.1 IDE硬盘接口</h3><p><img src="http://img.zhufengpeixun.cn/idedisk.jpg" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="idedisk"></p>
<h3 id="6-2-SCSI硬盘接口"><a href="#6-2-SCSI硬盘接口" class="headerlink" title="6.2 SCSI硬盘接口"></a>6.2 SCSI硬盘接口</h3><p><img src="http://img.zhufengpeixun.cn/SCSIdisk.jpg" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="SCSIdisk"></p>
<h3 id="6-3-SATA硬盘接口"><a href="#6-3-SATA硬盘接口" class="headerlink" title="6.3 SATA硬盘接口"></a>6.3 SATA硬盘接口</h3><p><img src="http://img.zhufengpeixun.cn/satadisk.jpeg" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="satadisk"></p>
<h2 id="7-分区"><a href="#7-分区" class="headerlink" title="7. 分区 "></a>7. 分区 </h2><p><img src="http://img.zhufengpeixun.cn/diskformat2.jpg" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="diskformat2"></p>
<ul>
<li>  磁盘分区是使用分区编辑器在磁盘上划分几个逻辑部分</li>
<li>  磁盘一旦划分成多个分区，不同类的目录与文件可以存储进不同的分区内</li>
</ul>
<h2 id="8-挂载点"><a href="#8-挂载点" class="headerlink" title="8. 挂载点 "></a>8. 挂载点 </h2><ul>
<li>  为了让Linux系统中可以访问这些分区，需要把这些分区挂载到对应的目录上</li>
<li>  在Linux中是把目录称为<code>挂载点</code></li>
<li>  把目录和分区链接在一起的过程成为<code>挂载</code></li>
<li>  <code>/</code>为根目录，必须挂载到一个分区上，默认所有子目录都会写入这个分区</li>
<li>  同一级目录下面的所有子目录可以有自己的独立存储空间</li>
<li>必须有的分区<ul>
<li>  / 根分区</li>
<li>  swap分区(交换分区，虚拟内存，一般为内存的2倍，不要超过2G)</li>
</ul>
</li>
<li>推荐分区<ul>
<li>  /boot (启动分区,200M) 单独分区，避免分区写满造成系统无法启动</li>
</ul>
</li>
</ul>
<h3 id="8-1-挂载示例"><a href="#8-1-挂载示例" class="headerlink" title="8.1 挂载示例"></a>8.1 挂载示例</h3><ul>
<li>  <code>/dev/sd2</code>挂载到了 <code>/</code>目录上,也就是说向<code>/</code>目录下在写文件就是往<code>/dev/sd2</code>分区里写文件</li>
<li>  <code>/dev/sd1</code>挂载到了 <code>/boot</code>目录上,也就是说向<code>/boot</code>目录下在写文件就是往<code>/dev/sd1</code>分区里写文件</li>
<li>  <code>/dev/sd3</code>挂载到了 <code>//home</code>目录上,也就是说向<code>//home</code>目录下在写文件就是往<code>/dev/sd3</code>分区里写文件</li>
</ul>
<p><img src="http://img.zhufengpeixun.cn/mount.jpg" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="mount"></p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E8%BF%90%E7%BB%B4/" class="category-chain-item">运维</a>
  
  
    <span>></span>
    
  <a href="/categories/%E8%BF%90%E7%BB%B4/linux/" class="category-chain-item">linux</a>
  
  

  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/%E8%BF%90%E7%BB%B4/">#运维</a>
      
        <a href="/tags/linux/">#linux</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>01.linux基础命令</div>
      <div>http://81.68.132.127/2022/10/23/dev_ops/linux/linux基础命令/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Ikki</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年10月23日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2022年10月30日</div>
        </div>
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/10/23/dev_ops/linux/vi%E5%91%BD%E4%BB%A4/" title="02.vi命令">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">02.vi命令</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/10/20/JS/binary/%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AF%B9%E8%B1%A1/" title="二进制对象">
                        <span class="hidden-mobile">二进制对象</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  <article id="comments" lazyload>
    
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"6KzYWc2oaEBaHgNl4UIicMJC-gzGzoHsz","appKey":"vJ4FIwKeHRmHraCJraAsjyZ7","path":"window.location.pathname","placeholder":"请输入你的评论\n昵称为必填项目(输入QQ号码可以自动获取昵称和邮箱)\n虽然email不是必选，但是填写了email可以收到推送通知哦！","avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":true,"recordIP":true,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":true},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


  </article>


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
      IKKI-专业BUG开发
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="busuanzi_container_site_pv" style="display: none">
        总访问量 
        <span id="busuanzi_value_site_pv"></span>
         次
      </span>
    
    
      <span id="busuanzi_container_site_uv" style="display: none">
        总访客数 
        <span id="busuanzi_value_site_uv"></span>
         人
      </span>
    
    
  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  
<script src="/fluid/js/star.js"></script>



<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
